<template>
  <el-input
    id="Input"
    v-model="Name"
    style="width: 240px"
    size="large"
    placeholder="Please Input adminname"
    :suffix-icon="Search"
    @change="FindFn"
  />
  <el-table :data="UseListArr" style="width: 100%">
    <el-table-column prop="adminname" label="用户名" />
    <el-table-column prop="role" label="角色" />
    <el-table-column prop="checkedKeys" label="checkedKeys" />
    <el-table-column prop="adminid" label="ID" />
  </el-table>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { Search } from '@element-plus/icons-vue'
import { FindManagerReq } from '../api/login.ts'
let Name = ref('')
const UseListArr = ref([])
function FindFn() {
  console.log(Name.value)
  FindManagerReq(Name.value).then((res) => {
    console.log(res.data)
    if (res.data.code == 200 && res.data.data.length != 0) {
      UseListArr.value = res.data.data
      ElMessage.success(res.data.message)
    } else {
      ElMessage.error('获取管理员信息失败,系统中没有该管理员信息！！！')
    }
  })
}
</script>
<style lang="scss" scoped>
.el-main .el-scrollbar {
  width: 100%;
  height: 40px;
}
#Input {
  width: 80%;
  height: 40px;
}
</style>
